package Services;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import java.sql.DriverManager;

public class DBConnection {
	
	private String serverName = "91.121.4.108:3306/malkin94";
	private String user = "malkin94";
	private String password = "Bm80veark";
	private Connection con;
	private String dbms = "mysql";
	
	
	public Connection getConnection(){
		
		con = null;
		Properties connectionProps = new Properties();
		connectionProps.put("user", this.user);
		connectionProps.put("password", this.password);
		
		try{
			Class.forName("com.mysql.jdbc.Driver");
		}catch (ClassNotFoundException e){
			e.printStackTrace();
		}
		
		try {
			con = DriverManager.getConnection("jdbc:mysql://91.121.4.108:3306/malkin94", connectionProps);
		} catch (SQLException e) {
			System.out.println("Connection Failed");
			e.printStackTrace();
		}
		
		return con;
	}
	
	
}
